{% extends 'AdminBundle:base:index.html.twig' %}
    {% block title %}微信{% endblock %}
    {% block description %}新建 微信.{% endblock %}
    {% block plugin_styles %}
        <link rel="stylesheet" href="/admin/assets/css/chosen.min.css"/>
    {% endblock %}

    {% block head %}{{ parent() }}{% endblock %}

    {% block breadcrumbs %}
        {% embed "AdminBundle:base:breadcrumbs.html.twig" %}
            {% block breadcrumb %}
                <li><a href="{{ path('basewebchatuser_index') }}">微信</a></li>
                <li class="active">新建</li>
            {% endblock %}
        {% endembed %}
    {% endblock %}


    {% block content %}
        {{ form_start(form) }}

        <div class="form-group">
            {{ form_label(form.nickname) }}

            <div class="col-sm-9">
                {{ form_widget(form.nickname) }}
                <span class="help-inline col-xs-12 col-sm-7">
                            <span class="middle">{{ form_errors(form.nickname) }}</span>
                        </span>
            </div>
        </div>
        <div class="space-6"></div>

        <div class="form-group">
            {{ form_label(form.userName) }}

            <div class="col-sm-9">
                {{ form_widget(form.userName) }}
                <span class="help-inline col-xs-12 col-sm-7">
                            <span class="middle">{{ form_errors(form.userName) }}</span>
                        </span>
            </div>
        </div>
        <div class="space-6"></div>

        <div class="form-group">
            {{ form_label(form.mobile) }}

            <div class="col-sm-9">
                {{ form_widget(form.mobile) }}
                <span class="help-inline col-xs-12 col-sm-7">
                            <span class="middle">{{ form_errors(form.mobile) }}</span>
                        </span>
            </div>
        </div>
        <div class="space-6"></div>

        <div class="form-group">
            {{ form_label(form.deviceImei) }}

            <div class="col-sm-2">
                {{ form_widget(form.deviceImei) }}
                <span class="help-inline col-xs-12 col-sm-7">
                    <a style="cursor:pointer;" class="ui-sghref" href="{{ path('basedevice_new') }}"><span
                                class="ui-icon ace-icon fa fa-plus center bigger-110 blue"></span></a>
                            <span class="middle">{{ form_errors(form.deviceImei) }}</span>
                        </span>
            </div>
        </div>
        <div class="space-6"></div>

        <div class="form-group">
            {{ form_label(form.note) }}

            <div class="col-sm-9">
                {{ form_widget(form.note) }}
                <span class="help-inline col-xs-12 col-sm-7">
                            <span class="middle">{{ form_errors(form.note) }}</span>
                        </span>
            </div>
        </div>
        <div class="space-6"></div>

        <div class="form-group">
            {{ form_label(form.isEnabled) }}
            <div class="col-sm-9">
                {{ form_widget(form.isEnabled) }}
                <span class="lbl"></span>
            </div>
        </div>
        <div class="space-6"></div>

        <div class="widget-box transparent">
            <div class="widget-header widget-header-flat">
                <h4 class="widget-title lighter">
                    <i class="ace-icon fa fa-star orange"></i>
                    全部显示
                </h4>

                <div class="widget-toolbar">
                    <a href="#" data-action="collapse">
                        <i class="ace-icon fa fa-chevron-up"></i>
                    </a>
                </div>
            </div>
            <div class="space-6"></div>

            <div class="widget-body">
                <div class="form-group">
                    {{ form_label(form.password) }}

                    <div class="col-sm-9">
                        {{ form_widget(form.password) }}
                        <span class="help-inline col-xs-12 col-sm-7">
                            <span class="middle">{{ form_errors(form.password) }}</span>
                        </span>
                    </div>
                </div>
                <div class="space-6"></div>

                <div class="form-group">
                    {{ form_label(form.email) }}

                    <div class="col-sm-9">
                        {{ form_widget(form.email) }}
                        <span class="help-inline col-xs-12 col-sm-7">
                            <span class="middle">{{ form_errors(form.email) }}</span>
                        </span>
                    </div>
                </div>
                <div class="space-6"></div>

                <div class="form-group">
                    {{ form_label(form.sex) }}

                    <div class="col-sm-9">
                        {{ form_widget(form.sex) }}
                        <span class="help-inline col-xs-12 col-sm-7">
                            <span class="middle">{{ form_errors(form.sex) }}</span>
                        </span>
                    </div>
                </div>
                <div class="space-6"></div>

                <div class="form-group">
                    {{ form_label(form.headImgUrl) }}

                    <div class="col-sm-9">
                        {{ form_widget(form.headImgUrl) }}
                        <span class="help-inline col-xs-12 col-sm-7">
                            <span class="middle">{{ form_errors(form.headImgUrl) }}</span>
                        </span>
                    </div>
                </div>
                <div class="space-6"></div>

                <div class="form-group">
                    {{ form_label(form.country) }}

                    <div class="col-sm-9">
                        {{ form_widget(form.country) }}
                        <span class="help-inline col-xs-12 col-sm-7">
                            <span class="middle">{{ form_errors(form.country) }}</span>
                        </span>
                    </div>
                </div>
                <div class="space-6"></div>

                <div class="form-group">
                    {{ form_label(form.province) }}

                    <div class="col-sm-9">
                        {{ form_widget(form.province) }}
                        <span class="help-inline col-xs-12 col-sm-7">
                            <span class="middle">{{ form_errors(form.province) }}</span>
                        </span>
                    </div>
                </div>
                <div class="space-6"></div>

                <div class="form-group">
                    {{ form_label(form.city) }}

                    <div class="col-sm-9">
                        {{ form_widget(form.city) }}
                        <span class="help-inline col-xs-12 col-sm-7">
                            <span class="middle">{{ form_errors(form.city) }}</span>
                        </span>
                    </div>
                </div>
                <div class="space-6"></div>

                <div class="form-group">
                    {{ form_label(form.signature) }}

                    <div class="col-sm-9">
                        {{ form_widget(form.signature) }}
                        <span class="help-inline col-xs-12 col-sm-7">
                            <span class="middle">{{ form_errors(form.signature) }}</span>
                        </span>
                    </div>
                </div>
                <div class="space-6"></div>

            </div>
        </div>

        <div class="clearfix form-actions">
            <div class="col-md-offset-3 col-md-9">
                <button class="btn btn-info" type="submit">
                    <i class="ace-icon fa fa-check bigger-110"></i>
                    Submit
                </button>
                &nbsp; &nbsp; &nbsp;
                <button class="btn" type="reset">
                    <i class="ace-icon fa fa-undo bigger-110"></i>
                    Reset
                </button>
            </div>
        </div>

        {{ form_end(form) }}

    {% endblock %}
    {% block plugin_scripts %}
        <script src="/admin/assets/js/chosen.jquery.min.js"></script>
    {% endblock %}

    {% block javascripts %}
        <script type="text/javascript">
            jQuery(function ($) {
                if (!ace.vars['touch']) {
                    $('.chosen-select').chosen({allow_single_deselect: true});
                    //resize the chosen on window resize

                    $(window)
                            .off('resize.chosen')
                            .on('resize.chosen', function () {
                                $('.chosen-select').each(function () {
                                    var $this = $(this);
                                    $this.next().css({'width': $this.parent().width()});
                                })
                            }).trigger('resize.chosen');
                    //resize chosen on sidebar collapse/expand
                    $(document).on('settings.ace.chosen', function (e, event_name, event_val) {
                        if (event_name != 'sidebar_collapsed') return;
                        $('.chosen-select').each(function () {
                            var $this = $(this);
                            $this.next().css({'width': $this.parent().width()});
                        })
                    });
                }
            });
        </script>
    {% endblock %}
